QT += quick serialport core gui network widgets
# 添加网络模块
CONFIG += serialport

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

# 源文件列表
SOURCES += \
        backend.cpp \
        common/backendprocessor.cpp \
        common/buttonmanager.cpp \
        common/logger.cpp \
        main.cpp \
        module/can/CanTester.cpp \
        module/can/canthread.cpp \
        module/gpio/GpioTest.cpp \
        module/i2c/I2CTest.cpp \
        module/net/ethernet.cpp \
        module/pcie/PcieTest.cpp \
        module/spi/SpiTest.cpp \
        module/uart/serialport.cpp \
        module/uart/serialporthelper.cpp

# QML 资源文件
RESOURCES += qml.qrc \
    icons.qrc

# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =

# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

# 头文件列表
HEADERS += \
    backend.h \
    common/CaTechCommon.h \
    common/backendprocessor.h \
    common/buttonmanager.h \
    common/logger.h \
    module/can/CanTester.h \
    module/can/ControlCAN.h \
    module/can/canthread.h \
    module/gpio/GpioTest.h \
    module/i2c/I2CTest.h \
    module/net/ethernet.h \
    module/pcie/PcieTest.h \
    module/spi/SpiTest.h \
    module/uart/serialport.h \
    module/uart/serialporthelper.h


# 根据操作系统条件化地添加库
win32 {
    # Windows 10 64 位下加载 ControlCAN.lib 库（静态库用于编译链接）
    CONFIG(release, debug|release): LIBS += -L$$PWD/lib/ -lControlCAN
    CONFIG(debug, debug|release): LIBS += -L$$PWD/lib/ -lControlCAN

    # 加载 Advapi32 库（根据你原配置中针对 Windows 的添加）
    LIBS += -lAdvapi32
} else: unix {

    LIBS += -lcrypt

    # Linux 64 位下加载 libcontrolcan.a 静态库（用于编译链接）
    CONFIG(release, debug|release): LIBS += -L$$PWD/lib/ -lcontrolcan

    # Linux 64 位下设置运行时动态库搜索路径（通过 rpath 方式，这里采用一种常见方式示例）
    CONFIG(release, debug|release): QMAKE_LFLAGS += -Wl,-rpath=$$PWD/lib
}


INCLUDEPATH += $$PWD/module/can
DEPENDPATH += $$PWD/module/can

DISTFILES +=

